import request from '@/utils/request'

/**
 * 登录
 * @param {} data
 * @returns
 */
export function login(data) {
  return request({
    url: '/api/user-service/user/login',
    method: 'POST',
    data
  })
}

export const imgCodeAPI = (clientToken) => {
  return request({
    url: `/api/user-service/user/imageCode/${clientToken}`,
    responseType: 'blob'
  })
}

/**
 * 获取用户信息
 * @param {*} id
 * @returns
 */
export const getUserInfoAPI = (id) => {
  return request({
    url: `/api/user-service/user/${id}`
  })
}

/**
 * 获取工单汇总信息
 * @param {*} start
 * @param {*} end
 * @returns
 */
export const getTaskReportInfoAPI = (start, end) => {
  return request({
    url: `/api/task-service/task/taskReportInfo/${start}/${end}`
  })
}

/**
 * 获取销售统计
 * @param {*} start
 * @param {*} end
 * @returns
 */
export const getCollectReportInfoAPI = (start, end) => {
  return request({
    url: `/api/task-service/task/collectReport/${start}/${end}`
  })
}

